# Contributor: Alan Lacerda <alacerda@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=mate-screensaver
pkgver=1.24.0
pkgrel=0
pkgdesc="A screen saver and locker for MATE"
url="https://github.com/mate-desktop/mate-screensaver"
arch="all !s390x !mips !mips64" # mate-desktop
license="GPL-2.0-or-later"
makedepends="intltool glib-dev libxscrnsaver-dev gtk+3.0-dev
	mate-desktop-dev dbus-glib-dev mate-menus-dev dconf-dev
	libnotify-dev libmatekbd-dev mate-session-manager libsm-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://pub.mate-desktop.org/releases/${pkgver%.*}/mate-screensaver-$pkgver.tar.xz"
builddir="$srcdir/$pkgname-$pkgver/"
options="suid"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--sysconfdir=/etc \
		--enable-static=no \
		--enable-locking=yes \
		--prefix=/usr \
		--without-console-kit
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	# https://gitweb.gentoo.org/repo/gentoo.git/tree/mate-extra/mate-screensaver
	chmod u+s "$pkgdir"/usr/libexec/mate-screensaver-dialog
}

sha512sums="8947b85ab8b006a1756649131a9184e4eb8f44c563f5a1b55840aa8280820713bca1ce46fece92b5ac44a73193bfe965e8ef0d17e8e403a751807ee72c674cc0  mate-screensaver-1.24.0.tar.xz"
